package cn.school.controller;

import cn.school.dto.CancelAppointDto;
import cn.school.dto.ExamAppointDto;
import cn.school.service.ExamAppointService;
import cn.school.vo.ResultVo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/examAppoint")
public class ExamAppointController {
    @Resource
    private ExamAppointService examAppointService;
    @RequestMapping("/appoint") //预约考试
    public ResultVo appoint(HttpServletRequest request,@RequestBody ExamAppointDto examAppointDto) {
       ResultVo resultVo= examAppointService.appoint(examAppointDto,request);
        return resultVo;
    }
    @RequestMapping("/cancelAppoint") //取消预约考试
    public ResultVo cancelAppoint(HttpServletRequest request,@RequestBody CancelAppointDto cancelAppointDto) {
        ResultVo resultVo= examAppointService.cancelAppoint(cancelAppointDto,request);
        return resultVo;
    }
}
